
import store from 'store'

const user_token_key = 'admin_token'
export const getToken = ()=>{
	return store.get(user_token_key) || null
}
export const setToken = (data)=>{
	store.set(user_token_key,data)
}
export const removeToken = ()=>{
	store.remove(user_token_key)
}

const user_info_key = 'pcg_user_info_admin_token'

export const getUserInfo = ()=>{
	return store.get(user_info_key) || {}
}
export const setUserInfo = (data)=>{
	store.set(user_info_key,data)
}
export const removeUserInfo = ()=>{
	store.remove(user_info_key)
}

const permission_token = 'fan_admin_menu_permission'
export const getResourceMenu = ()=>{
	return store.get(permission_token) || ''
}
export const setResourceMenu = (data)=>{
	store.set(permission_token,data)
}
const permission_button_token = 'fan_admin_button_permission'
export const getResourceButtons = ()=>{
	return store.get(permission_button_token) || ''
}
export const setResourceButtons = (data)=>{
	store.set(permission_button_token,data)
}

export const removeAllData = ()=>{
  store.clearAll()
}
